Managing metadata for data in a copy relationship

ABSTRACT

Provided are a computer program product, system, and method for managing metadata for data in a copy relationship copied from a source storage to a target storage. Information is maintained on a copy relationship of source data in the source storage and target data in the target storage. The source data is copied from the source storage to the cache to copy to target data in the target storage indicated in the copy relationship. Target metadata is generated for the target data comprising the source data copied to the cache. An access request to requested target data comprising the target data in the cache is processed and access is provided to the requested target data in the cache. A determination is made as to whether the requested target data in the cache has been destaged to the target storage. The target metadata for the requested target data in the target storage is discarded in response to determining that the requested target data in the cache has not been destaged to the target storage.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a computer program product, system, andmethod for managing metadata for data in a copy relationship.

2. Description of the Related Art

In a storage environment, source volumes may be mirrored to targetvolumes to provide redundant copies of data. The source and targetvolumes may be in different storage devices to provide furtherredundancy. A point-in-time copy replicates data in a manner thatappears instantaneous and allows a host to continue accessing the sourcevolume while actual data transfers to the copy volume are deferred to alater time. The point-in-time copy appears instantaneous becausecomplete is returned to the copy operation in response to generating therelationship data structures without copying the data. The point-in-timecopy relationships that are immediately established in response to thepoint-in-time copy command include a bitmap or other data structureindicating the location of blocks in the volume at either the sourcevolume or the copy volume.

Point-in-time copy techniques, such as the IBM FlashCopy® (FlashCopy isa registered trademark of International Business Machines, Corp. or“IBM”), typically defer the transfer of the source volume tracks in thecopy relationship to the corresponding target volume until a writeoperation is requested to that data block on the source volume. Datatransfers may also proceed as a background copy process with minimalimpact on system performance. Further, a source track in the copyrelationship may be copied to the corresponding target track in the copyrelationship in response to a read request to the corresponding targettrack.

A command to withdraw the copy relationship may be submitted. Toimplement a copy relationship withdraw operation, the target metadatafor all the target volume tracks in the copy relationship is discardedin the target storage system and any target tracks in the copyrelationship, modified or unmodified, residing in cache, are demoted,i.e., discarded. As part of the copy relationship withdraw operation,access to the target volume is quiesced until all the metadata for thetarget volume in the target storage is discarded. Following the withdrawoperation, the target metadata for a requested target track needs to berebuilt when the target track is subsequently requested because all themetadata for the target volume in the target storage was discardedduring the copy relationship withdraw operation.

The target metadata for the target volume is discarded to prevent amismatch of the target metadata data in the target storage and thetarget tracks described by the metadata. This mismatch may occur if atthe time of the withdraw operation, target metadata for modified targettracks in cache is destaged to the target storage before the modifiedtarget tracks. For this reason, during the copy withdraw operation, alltarget metadata in the volume is discarded to avoid this mismatch of thetarget storage having target metadata having information that isinconsistent with the corresponding target tracks in the target storage.

There is a need in the art for improved techniques for managing metadatain the storage system and cache.

SUMMARY

Provided are a computer program product, system, and method for managingmetadata for data in a copy relationship copied from a source storage toa target storage. Information is maintained on a copy relationship ofsource data in the source storage and target data in the target storage.The source data is copied from the source storage to the cache to copyto target data in the target storage indicated in the copy relationship.Target metadata is generated for the target data comprising the sourcedata copied to the cache. An access request to requested target datacomprising the target data in the cache is processed and access isprovided to the requested target data in the cache. A determination ismade as to whether the requested target data in the cache has beendestaged to the target storage. The target metadata for the requestedtarget data in the target storage is discarded in response todetermining that the requested target data in the cache has not beendestaged to the target storage.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an embodiment a computing environment.

FIG. 2 illustrates an embodiment of copy relation information.

FIG. 3 illustrates an embodiment of operations to copy source data totarget data in a copy relationship.

FIG. 4 illustrates an embodiment of operations to process a writerequest to target data.

FIG. 5 illustrates an embodiment of operations to destage target data ina copy relationship to target storage.

FIG. 6 illustrates an embodiment of operations to process a read requestto target data in a copy relationship.

FIG. 7 illustrates an embodiment of operations performed when an accessrequest to target data completes.

FIG. 8 illustrates an embodiment of operations performed to process arequest to withdraw a copy relationship.

DETAILED DESCRIPTION

FIG. 1 illustrates an embodiment of a storage server 2 coupled to asource storage 4 a and a target storage 4 b. The storage server 2includes a processor 6 and a memory 8 having an Input/Output (I/O)manager 10, copy relationship information 12, a modified data structure14, and a cache 16. The copy relationship information 12 provides arelationship information for each instance of a copy operation to copysource data 18 a in the source storage 4 a to target data 18 b in thetarget storage 4 b. The target and source data 18 a, 18 b specified forthe copy relationships 12 may comprise tracks, logical block addresses(LBAs), volumes, or any other units of data known in the art. The I/Omanager 10 manages the copying of source data 18 a to target data 18 bas part of a copy relationship 12, and manages I/O access to the targetstorage 4 b from a host 22, connected to the server over network 20. Thesource 4 a and target 4 b storages may further maintain source metadata24 a and target metadata 24 b, respectively, providing metadata for thesource 18 a and target 18 b data. Metadata includes informationdescribing the contents of the source and target data for which themetadata is provided, such as a format of the data, number of records,record size, content of the data, etc. One unit of metadata 24 a, 24 bmay provide information for multiple units of source 18 a and targetdata 18 b, such as for units of tracks, blocks, etc. The source 18 a andtarget data 18 b may comprise customer data.

The source data 18 a and metadata 24 a and target data 18 b and metadata24 b may be maintained in the source 4 a and target 4 b storages,respectively, and also in the cache 16. In the cache 16, the data 18 a,18 b and metadata 20 a, 20 b may be modified and then subsequentlydestaged to the storages 4 a, 4 b for persistent storage.

The storage server 2 may receive read and write requests directed to thetarget storage 4 b from a host 20 over a network 22. The modified datastructure 14 indicates target data in the cache 16 that has beenmodified and needs to be destaged to the target storage 4 b. Themodified target data 18 b in the cache may comprise updates from thehost 22 to the target data 18 b or source data 18 a copies to the targetdata 18 b transferred to the cache 16 as part of a background copyoperation for the copy relationship 12.

The storages 4 a, 4 b may comprise storage media implemented in one ormore storage devices known in the art, such as interconnected hard diskdrives (e.g., configured as a DASD, RAID, JBOD, etc.), solid statestorage devices (e.g., EEPROM (Electrically Erasable ProgrammableRead-Only Memory), flash memory, flash disk, storage-class memory(SCM)), electronic memory, magnetic tape media, etc. The memory 8 andcache 16 may be comprised of one or more volatile or non-volatile memorydevices known in the art.

In FIG. 1, the I/O manager 10 is shown as a software program in thememory 8 executed by the processor 6. In an alternative embodiment, theI/O manager 10 may be implemented in a hardware component, such asdedicated integrated circuit, e.g., Application Specific IntegratedCircuit (ASIC), expansion card, etc., in the storage server 100 orimplemented as a combination of hardware or software.

The network 22 may comprise a Wide Area Network (WAN), Local AreaNetwork (LAN), Storage Area Network (SAN), wireless network, theInternet, an Intranet, peer-to-peer network, etc. The storage server 2may connect to the storages 4 a and 4 b with a direct connection orcable, over the Internet or through multiple switches and cables in aWAN, SAN, LAN, etc.

FIG. 2 illustrates an embodiment of an instance of copy relationshipinformation 50 maintained in the copy relationships 12 for one copyrelationship including a copy relationship identifier (ID) 52identifying a relation of source data 54, such as a volume or group oftracks or blocks, to copy to target data 56, and a copy data structure58 indicating portions of the source data 54, such as tracks, blocks,extents, copied to the target data 56 in the copy relationship 50. Thecopy relationship 50 may indicate specific source data units 54 andcorresponding target data units 56 to which the source data units arecopied.

The copy relationship 50 may represent a logical or virtual copyoperation, such as FlashClopy, where the initial copy operation iscompleted instantaneously upon creating the copy relationship 50 datastructures, and the source data 54 may be copied in the background overto the target data 56 as part of background copy processes that seek tominimize impact on the server 2 resources and performance.

FIG. 3 illustrates an embodiment of operations performed by the I/Omanager 10 to initiate an operation to copy the source data 54 in a copyrelationship 50 to the corresponding target data 56. Upon initiating (atblock 100) the operation to copy the source data 54 to the target data56, the I/O manager 10 determines (at block 102) from the copy datastructure 12 source data to copy to target data, such as sectors,tracks, blocks, etc. The I/O manager 10 then copies (at block 104) thedetermined source data 54 to the cache 16 to write to the correspondingtarget data 56 in the copy relationship 50. The I/O manager 10 builds(at block 106) target metadata 24 b for the corresponding target data inthe cache 16 comprising the source data 54 copied into the cache 16. Thebuilt target metadata 24 b may include metadata for the target data 18 bsubject to the specific operation and additional units of target data,such as tracks, blocks, sectors, etc. The I/O manager 10 indicates (atblock 108) in the modified data structure 14 the corresponding targetdata 56 in the cache 16 updated from the source data 54 to make eligiblefor destaging to the target storage 4 b as part of a subsequent destageprocess.

FIG. 4 illustrates an embodiment of operations performed by the I/Omanager 10 to process a write request from the host 22. Upon receiving(at block 120) a write request having write data to write to target data18 b, the I/O manager 10 writes (at block 122) the write data to thecache 16 as target data 18 b and builds (at block 124) target metadata24 b for the updated target data 18 b in the cache 16. The I/O manager10 further updates (at block 126) the modified data structure 14 toindicate that the target data 18 b in the cache 16 is modified so thatthe modified target data and its built metadata 24 b are eligible fordestaging as part of a subsequent destage operation.

FIG. 5 illustrates an embodiment of operations performed by the I/Omanager 10 to destage target data 18 b in the cache 16 in a copyrelationship 50 to the target storage 4 b. Upon initiating (at block150) the destage operation, if (at block 152) the destage operationsucceeded, then the I/O manager 10 updates (at block 156) the modifieddata structure 14 to indicate that the destaged target data is notmodified and updates (at block 158) the copy data structure 12 toindicate the corresponding source data 54 in the copy relationship 50has been copied or mirrored to the corresponding target data 56. Oncethe target data 18 b has been modified with more current data, then evenif the corresponding source data 54 was not previously copied over,there is no need to copy over since the target data 56 has been updated.If (at block 152) the destage did not complete, then the I/O manager 10discards (at block 154) the target metadata 24 b for the target data 18b whose destage failed. This discarding of the target metadata 24 b forthe failed destage will prevent a situation from occurring where therebuilt target metadata 24 b is destaged, but the corresponding targetdata 18 b is not destaged, and is prevented from being destaged due to acopy relationship withdrawal operation which demotes the target data 18b in the cache 16 while leaving the target metadata 24 b for the demotedtarget data 18 b not destaged in the target storage 4 b.

FIG. 6 illustrates an embodiment of operations performed by the I/Omanager 10 to process (at block 200) a read request to target data 56 ina copy relationship 50 in the target storage 4 b. If (at block 202) therequested target data 18 b is in the cache 16 and if (at block 204)there is valid target metadata 24 b for the requested target data 56 inthe cache 16, then the I/O manager 10 provides (at block 208) readaccess to the requested target data 18 b and its metadata 24 b in thecache 16. If (at block 202) there is not valid target metadata 24 b forthe requested target data 18 b in the cache 16, then the I/O manager 10generates (at block 206) target metadata 24 b for the requested targetdata 18 b in the cache 16 and control then proceeds to block 208 toprovide read access to the target data 18 b and its metadata 24 b.

If (at block 202) the requested target data 18 b is not in the cache 16and if (at block 210) the copy data structure 58 indicates that thecorresponding source data 54 for the requested target data 18 b or 56 inthe copy relationship 50 has not been copied to the target storage 4 b,then the I/O manager 10 copies (at block 212) the corresponding sourcedata to the requested target data 18 b in the cache 16. Control thenproceeds to block 206 to build target metadata 24 b and provide readaccess to the requested target data 18 b in the cache 16. If (at block210) the copy data structure 58 indicates that the corresponding sourcedata 54 for the requested target data 18 b, 56 in the copy relationship50 has already been copied to the target storage 4 b, then the I/Omanager 10 stages (at block 214) the requested target data from thetarget storage 4 b into the cache 16. If (at block 216) the cache 16already includes valid metadata 24 b for the staged target data 18 b,then read access is provided (at block 208) to the target data 18 b inthe cache 16. If (at block 216) the cache 16 does not include therequested target data, then the I/O manager stages (at block 218) thetarget metadata 24 b for the requested target data 18 b from the targetstorage 4 b to the cache 16 and control proceeds to block 208 to provideread access to the requested target data 18 b and its metadata 24 b inthe cache 16.

FIG. 7 illustrates an embodiment of operations performed by the I/Omanager 10 to process metadata 24 b for accessed target data 18 b in thecache 18 after the access operation ends. Upon the access ending (atblock 250), but before the access completes, if (at block 252) theaccess is a write, then the access request is ended, such as with anacknowledgment to the host 22 of write complete. If (at block 252) theaccess is a read, then the I/O manager 10 determines (at block 254)whether the accessed target data 18 b was destaged. If so, then controlends, leaving the target metadata 24 b for the accessed target data 18 bin the cache 16. If (at block 254) the accessed target data was notdestaged, then the I/O manager discards (at block 256) the targetmetadata 24 b for the requested target data in the target storage 4 b.This discarding of the target metadata 24 b prevents a mismatch if thetarget metadata 24 b is destaged but the corresponding target data 18 bcannot be destaged before the withdrawal of the copy relationship.

FIG. 8 illustrates an embodiment of operations performed by the I/Omanager 10 to process a request to withdraw a copy relationship. Uponreceiving (at block 280) a request to withdraw a copy relationship 50,the I/O manager demotes, i.e., discards, (at block 282) all the targetdata 18 b in the cache 16 for the copy relationship 50 being withdrawn.For target data 18 b indicated as modified in the cache 16 in themodified data structure 14, the I/O manager 10 discards (at block 284)the target metadata in the target storage 4 b for the demoted/discardedmodified target data 56 in the cache 16. The copy relationship 50 isthen indicated as withdrawn (at block 286), which would also end anybackground copy operation of the source data 54 to the correspondingtarget data 56 in the target storage 4 b.

With the embodiment of FIG. 8, the target metadata 24 b in the targetstorage 4 b is discarded in the event that the target metadata 24 b wasdestaged to the target storage 4 b before the target data in the cache16 was discarded. If this operation was not performed, then the targetmetadata 24 b destaged to the target storage 4 b may not reflect thetarget data 18 b in the target storage 4 b, but instead reflect thediscarded target data 18 b in the cache 16. Thus, discarding the targetmetadata in the target storage 4 b prevents this mismatch of targetmetadata 24 b and target data 18 b in the storage 4 b.

Described embodiments provide techniques for managing target metadata inthe cache so as to limit the amount of target metadata that needs to bediscarded if the copy relationship is withdrawn by discarding targetmetadata for requested target data in the cache that has not beendestaged. In this way, the amount of target metadata that needs to bediscarded at the time of the copy withdrawal operation is reduced toavoid delays that could adversely affect server performance because I/Oactivity to target storage data may be queisced during the time requiredto discard the target metadata as part of the copy withdrawal operation.

The described operations may be implemented as a method, apparatus orcomputer program product using standard programming and/or engineeringtechniques to produce software, firmware, hardware, or any combinationthereof. Accordingly, aspects of the embodiments may take the form of anentirely hardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module” or “system.” Furthermore,aspects of the embodiments may take the form of a computer programproduct embodied in one or more computer readable medium(s) havingcomputer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described above with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The variables “a” and “b” when used to represent a variable number of anelement may indicate any number of instances of the element, and mayindicate different integer numbers when used with different elements orwhen used with different instances of the same element. For instancevariables “a” and “b” used to indicate a number of a source storage andtarget storage may indicate the same or different number of theseelements.

The terms “an embodiment”, “embodiment”, “embodiments”, “theembodiment”, “the embodiments”, “one or more embodiments”, “someembodiments”, and “one embodiment” mean “one or more (but not all)embodiments of the present invention(s)” unless expressly specifiedotherwise.

The terms “including”, “comprising”, “having” and variations thereofmean “including but not limited to”, unless expressly specifiedotherwise.

The enumerated listing of items does not imply that any or all of theitems are mutually exclusive, unless expressly specified otherwise.

The terms “a”, “an” and “the” mean “one or more”, unless expresslyspecified otherwise.

Devices that are in communication with each other need not be incontinuous communication with each other, unless expressly specifiedotherwise. In addition, devices that are in communication with eachother may communicate directly or indirectly through one or moreintermediaries.

A description of an embodiment with several components in communicationwith each other does not imply that all such components are required. Onthe contrary a variety of optional components are described toillustrate the wide variety of possible embodiments of the presentinvention.

Further, although process steps, method steps, algorithms or the likemay be described in a sequential order, such processes, methods andalgorithms may be configured to work in alternate orders. In otherwords, any sequence or order of steps that may be described does notnecessarily indicate a requirement that the steps be performed in thatorder. The steps of processes described herein may be performed in anyorder practical. Further, some steps may be performed simultaneously.

When a single device or article is described herein, it will be readilyapparent that more than one device/article (whether or not theycooperate) may be used in place of a single device/article. Similarly,where more than one device or article is described herein (whether ornot they cooperate), it will be readily apparent that a singledevice/article may be used in place of the more than one device orarticle or a different number of devices/articles may be used instead ofthe shown number of devices or programs. The functionality and/or thefeatures of a device may be alternatively embodied by one or more otherdevices which are not explicitly described as having suchfunctionality/features. Thus, other embodiments of the present inventionneed not include the device itself.

The illustrated operations of FIGS. 3-8 show certain events occurring ina certain order. In alternative embodiments, certain operations may beperformed in a different order, modified or removed. Moreover, steps maybe added to the above described logic and still conform to the describedembodiments. Further, operations described herein may occur sequentiallyor certain operations may be processed in parallel. Yet further,operations may be performed by a single processing unit or bydistributed processing units.

The foregoing description of various embodiments of the invention hasbeen presented for the purposes of illustration and description. It isnot intended to be exhaustive or to limit the invention to the preciseform disclosed. Many modifications and variations are possible in lightof the above teaching. It is intended that the scope of the invention belimited not by this detailed description, but rather by the claimsappended hereto. The above specification, examples and data provide acomplete description of the manufacture and use of the composition ofthe invention. Since many embodiments of the invention can be madewithout departing from the spirit and scope of the invention, theinvention resides in the claims herein after appended.

1. A computer program product for managing data being copied from asource storage to a target storage, the computer program productcomprising a computer readable storage medium having computer readableprogram code embodied therein that executes to communicate with thesource storage, the target storage and a cache and to performoperations, the operations comprising: maintaining information on a copyrelationship of source data in the source storage and target data in thetarget storage; copying source data from the source storage to the cacheto copy to target data in the target storage indicated in the copyrelationship; generating target metadata for the target data comprisingthe source data copied to the cache; processing an access request torequested target data comprising the target data in the cache; providingaccess to the requested target data in the cache; determining whetherthe requested target data in the cache has been destaged to the targetstorage; and discarding the target metadata for the requested targetdata in the target storage in response to determining that the requestedtarget data in the cache has not been destaged to the target storage. 2.The computer program product of claim 1, wherein the operations ofdetermining whether the requested target data in the cache has beendestaged and discarding the target metadata are performed after theaccess request is processed.
 3. The computer program product of claim 1,wherein the request comprises a read request.
 4. The computer programproduct of claim 3, wherein the operations further comprise: receiving asubsequent read request to the requested target data after completingthe processed read request; rebuilding target metadata for the requestedtarget data for the subsequent read request; providing access to therequested target data in the cache for the subsequent read request;determining whether the requested target data in the cache has beendestaged to the target storage; and discarding the rebuilt targetmetadata for the requested target data in the target storage in responseto determining that the requested target data in the cache has not beendestaged to the target storage.
 5. The computer program product of claim3, wherein the operations further comprise: retaining the targetmetadata for the requested target data in the cache to destage to thetarget storage in response to determining that the requested target datahas been destaged to the target storage.
 6. The computer program productof claim 3, wherein the operations further comprise: receiving a requestto withdraw the copy relationship; and demoting the target data in thecache in the copy relationship in response to receiving the request towithdraw the copy relationship.
 7. The computer program product of claim3, wherein the operations further comprise: receiving a write request towrite data to the target data in the copy relationship; updating thetarget data in the cache with the write data; generating target metadatafor the updated target data in the cache; and indicating in a datastructure the updated target data in the cache, wherein the indicationis removed in response to destaging the updated target data and themetadata for the updated target data to the target storage.
 8. Thecomputer program product of claim 7, wherein the operations furthercomprise: receiving a request to withdraw the copy relationship;demoting the target data in the cache indicated in the copy relationshipin response to receiving the request to withdraw the copy relationship;and discarding the target metadata data in the target storage for thetarget data indicated in the data structure.
 9. The computer programproduct of claim 1, wherein the operations further comprise: determiningthat an attempt to destage the target data to the target storage hasfailed; and discarding the target metadata in the target storage for thetarget data whose destage failed in response to determining that thedestage of the target data failed.
 10. A system in communication with asource storage and a target storage, comprising: a processor; a cache; acomputer readable storage medium having computer readable program codeembodied therein executed by the processor to perform operations, theoperations comprising: maintaining information on a copy relationship ofsource data in the source storage and target data in the target storage;copying source data from the source storage to the cache to copy totarget data in the target storage indicated in the copy relationship;generating target metadata for the target data comprising the sourcedata copied to the cache; processing an access request to requestedtarget data comprising the target data in the cache; providing access tothe requested target data in the cache; determining whether therequested target data in the cache has been destaged to the targetstorage; and discarding the target metadata for the requested targetdata in the target storage in response to determining that the requestedtarget data in the cache has not been destaged to the target storage.11. The system of claim 10, wherein the operations of determiningwhether the requested target data in the cache has been destaged anddiscarding the target metadata are performed after the access request isprocessed.
 12. The system of claim 10, wherein the request comprises aread request, wherein the operations further comprise: receiving asubsequent read request to the requested target data after completingthe processed read request; rebuilding target metadata for the requestedtarget data for the subsequent read request; providing access to therequested target data in the cache for the subsequent read request;determining whether the requested target data in the cache has beendestaged to the target storage; and discarding the rebuilt targetmetadata for the requested target data in the target storage in responseto determining that the requested target data in the cache has not beendestaged to the target storage.
 13. The system of claim 10, wherein therequest comprises a read request, wherein the operations furthercomprise: retaining the target metadata for the requested target data inthe cache to destage to the target storage in response to determiningthat the requested target data has been destaged to the target storage.14. The system of claim 10, wherein the request comprises a readrequest, wherein the operations further comprise: receiving a request towithdraw the copy relationship; and demoting the target data in thecache in the copy relationship in response to receiving the request towithdraw the copy relationship.
 15. The system of claim 10, wherein therequest comprises a read request, wherein the operations furthercomprise: receiving a write request to write data to the target data inthe copy relationship; updating the target data in the cache with thewrite data; generating target metadata for the updated target data inthe cache; and indicating in a data structure the updated target data inthe cache, wherein the indication is removed in response to destagingthe updated target data and the metadata for the updated target data tothe target storage.
 16. A method, comprising: maintaining information ona copy relationship of source data in a source storage and target datain a target storage; copying source data from the source storage to acache to copy to target data in the target storage indicated in the copyrelationship; generating target metadata for the target data comprisingthe source data copied to the cache; processing an access request torequested target data comprising the target data in the cache; providingaccess to the requested target data in the cache; determining whetherthe requested target data in the cache has been destaged to the targetstorage; and discarding the target metadata for the requested targetdata in the target storage in response to determining that the requestedtarget data in the cache has not been destaged to the target storage.17. The method of claim 16, wherein the operations of determiningwhether the requested target data in the cache has been destaged anddiscarding the target metadata are performed after the access request isprocessed.
 18. The method of claim 16, wherein the request comprises aread request, further comprising: receiving a subsequent read request tothe requested target data after completing the processed read request;rebuilding target metadata for the requested target data for thesubsequent read request; providing access to the requested target datain the cache for the subsequent read request; determining whether therequested target data in the cache has been destaged to the targetstorage; and discarding the rebuilt target metadata for the requestedtarget data in the target storage in response to determining that therequested target data in the cache has not been destaged to the targetstorage.
 19. The method of claim 16, wherein the request comprises aread request, further comprising: retaining the target metadata for therequested target data in the cache to destage to the target storage inresponse to determining that the requested target data has been destagedto the target storage.
 20. The method of claim 16, wherein the requestcomprises a read request, further comprising: receiving a request towithdraw the copy relationship; and demoting the target data in thecache in the copy relationship in response to receiving the request towithdraw the copy relationship.
 21. The method of claim 16, wherein therequest comprises a read request, further comprising: receiving a writerequest to write data to the target data in the copy relationship;updating the target data in the cache with the write data; generatingtarget metadata for the updated target data in the cache; and indicatingin a data structure the updated target data in the cache, wherein theindication is removed in response to destaging the updated target dataand the metadata for the updated target data to the target storage.